Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http parser performance #468

Merged
merged 3 commits into from
Dec 8, 2015
Merged

http parser performance #468

merged 3 commits into from
Dec 8, 2015

Conversation

urso
Copy link

@urso urso commented Dec 7, 2015

requires #442 and #453 + some rebase and history updated after merging these two.

Reduce allocations in http parser.

benchmarks:

original:
BenchmarkHTTPSimpleResponse-4         100000         15197 ns/op        3552 B/op        140 allocs/op
BenchmarkHTTPSimpleRequest-4          100000         17538 ns/op        4320 B/op        154 allocs/op
BenchmarkHTTPSplitResponse-4          100000         15665 ns/op        3840 B/op        141 allocs/op
BenchmarkHttpSimpleTransaction-4       30000         44417 ns/op       11039 B/op        348 allocs/op

optimized
BenchmarkHTTPSimpleResponse-4         500000          2837 ns/op         560 B/op          2 allocs/op
BenchmarkHTTPSimpleRequest-4          500000          3217 ns/op         640 B/op          3 allocs/op
BenchmarkHTTPSplitResponse-4         1000000          3454 ns/op         848 B/op          3 allocs/op
BenchmarkHttpSimpleTransaction-4      100000         17065 ns/op        4398 B/op         58 allocs/op

@urso urso added the discuss Issue needs further discussion. label Dec 7, 2015
@urso
Copy link
Author

urso commented Dec 8, 2015

benchmark results with guarded debug statements:

BenchmarkHTTPSimpleResponse-4        1000000          2641 ns/op         560 B/op          2 allocs/op
BenchmarkHTTPSimpleRequest-4          500000          3113 ns/op         640 B/op          3 allocs/op
BenchmarkHTTPSplitResponse-4          500000          3223 ns/op         848 B/op          3 allocs/op
BenchmarkHttpSimpleTransaction-4      100000         15572 ns/op        4045 B/op         50 allocs/op

@andrewkroh
Copy link
Member

LGTM. Just needs #442 to merge and then a rebase.

urso added 3 commits December 8, 2015 19:44
guard debug statements so no additional memory allocation happen for supressed
debugging output.
if p == -1 {
return 0, "", errors.New("Not beeing able to identify status code")
return 0, nil, errors.New("Not beeing able to identify status code")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not new, but "beeing" and spelled wrong and can just be dropped form the message. It can be fixed at other time and PR.

andrewkroh added a commit that referenced this pull request Dec 8, 2015
@andrewkroh andrewkroh merged commit 0e2970f into elastic:master Dec 8, 2015
@urso urso deleted the enh/http-perf branch December 9, 2015 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. enhancement Packetbeat review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants